<template>
    <div class="user">
        <div class="user-info">
            <div class="left">
                <van-image
                    class="avater"
                    :src="theImg"
                    round
                    fit="cover"
                    @click="$router.push('/mineSetting')"
                />
            </div>
            <div class="cente">
                <span>{{ theUname }}</span>
                <div class="novip">
                    <div class="false">vip</div>
                    <div>你不是vip</div>
                </div>
                <div class="vip">
                    <div>vip</div>
                </div>
            </div>
            <div class="right">
                <i>
                    <van-icon
                        name="setting"
                        size="24"
                        @click.native="$router.push('allSetting')"
                    />
                </i>
            </div>
        </div>
        <div class="user-lunbo">
            <div class="fix">您有{{ bumber }}积分可兑换</div>
            <Donhua class="donhua" />
        </div>
        <div class="user-pianku" @click="$router.push('/myku')">
            <div class="fix">我的片库</div>
            <div class="one">
                想看、在追、没看完的都在
                <i><van-icon name="arrow"/></i>
            </div>
            <van-tabs>
                <van-tab
                    class="vanTab"
                    v-for="item in list"
                    :key="item.videoId"
                    :swipeable="true"
                    :scrollspy="true"
                >
                    <template #title>
                        <div class="imageo">
                            <!-- <img :src="item.imgURL" /> -->
                            <van-image  class="img" fit="cover" :src="item.imgURL" />
                        </div>
                    </template>
                </van-tab>
            </van-tabs>
        </div>
        <div class="userbig">
            <div class="user-tu">
                <div class="userla" @click="$router.push('/home')">
                    <div class="tu">
                        <van-icon name="star" size="35" color="#6C6C6C" />
                    </div>
                    <div>影视</div>
                </div>
                <div class="userla" @click="$router.push('/shortplay')">
                    <div class="tu">
                        <van-icon name="star" size="35" color="#6C6C6C" />
                    </div>
                    <div>短视频</div>
                </div>
                <div class="userla"  @click="$router.push('/integral')">
                    <div class="tu">
                        <van-icon name="star" size="35" color="#6C6C6C" />
                    </div>
                    <div>会员</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { getAllHistory } from '../../api/jiang/vip';
export default {
    data() {
        return {
            name: '小分队',
            bumber: 4124,
            list: []
        }
    },
    computed: {
        ...mapGetters(['theImg', 'theUname'])
    },
    created() {
        this.getAllHistory();
    },
    methods: {
        async getAllHistory() {
            try {
                const { data } = await getAllHistory();
                this.list = data.data;
            } catch (error) {
                console.log(error);
            }
        }

    }
}
</script>

<style lang="scss" scoped>
.user {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    background-color: #eeeeee;
}
.user-info {
    height: 100px;
    margin: 40px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 40px;
}
.left {
    height: 100%;
    flex: 1;
}
.cente {
    flex: 3;
    text-align: left;
}
.novip {
    display: block;
}
.novip div {
    float: left;
    padding-left: 10px;
    font-size: 30px;
    margin: 10px 0 0 0;
    height: 32px;
    line-height: 32px;
}
.vip {
    display: none;
    font-size: 30px;
    margin: 10px 0 0 0;
    height: 32px;
    text-align: center;
    line-height: 32px;
}
.novip div:nth-child(2) {
    color: #ff9800;
    width: 200px;
}
.false {
    width: 50px;
    background-color: #c3c3c3;
    border-radius: 16px;
    color: white;
}
.vip div {
    width: 50px;
    background-color: #ff9800;
    border-radius: 16px;
}
.right {
    padding: 26px;
    text-align: right;
    flex: 1;
}
.avater {
    width: 100px;
    height: 100px;
}
.user-lunbo {
    width: 670px;
    height: 360px;
    border-radius: 30px;
    background-color: rgba(108, 108, 108, 100);
    margin: 0px 40px 30px 40px;
    font-size: 40px;
    padding-top: 40px;
    text-align: left;
    color: #fff;
    overflow: hidden;
}
.fix {
    margin-left: 40px;
}
.one {
    float: left;
    position: absolute;
    top: 60px;
    right: 40px;
    font-size: 20px;
    color: #aeaeae;
}
.donhua {
    padding-top: 50px;
}
.user-pianku {
    position: relative;
    width: 670px;
    height: 320px;
    border-radius: 30px;
    background-color: rgba(108, 108, 108, 100);
    margin: 0px 40px 30px 40px;
    font-size: 40px;
    padding-top: 40px;
    text-align: left;
    color: #fff;
}
/deep/.van-tabs--line .van-tabs__wrap {
    height: 180px;
    margin-top: 40px;
}
/deep/ .van-tabs__wrap--scrollable .van-tabs__nav {
    background-color: rgba(108, 108, 108, 100);
}
/deep/ .van-tabs__line {
    display: none;
}
.imageo{
    width: 128px;
    height: 180px;
}
.img {
    width: 100%;
    height: 100%;
}
.userbig {
    margin: 0px 40px;
    height: 170px;
    overflow: hidden;
}
.user-tu {
    height: 100%;
    width: 1000px;
}
.user-tu div {
    position: relative;
    width: 170px;
    height: 100%;
    margin: 0 30px;
    border-radius: 20%;
    background-color: rgba(108, 108, 108, 100);
    float: left;
}
.user-tu .tu {
    position: absolute;
    left: 10px;
    top: 20px;
    width: 90px;
    height: 90px;
    background-color: #fff;
    text-align: center;
    line-height: 90px;
    border-radius: 50%;
}
.userla div:nth-child(2) {
    top: 125px;
    left: -10px;
    font-size: 25px;
    position: absolute;
    width: 130px;
    height: 20px;
    color: #fff;
}
</style>
